package com.xyjf.prod.tools.prod_tools.contorller;

import com.xyjf.prod.tools.prod_tools.page.EasyUiPage;
import com.xyjf.prod.tools.prod_tools.service.IMlptBannnerService;
import com.xyjf.prod.tools.prod_tools.util.MyRequestMapUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@RestController
@RequestMapping("/sjdBanner")
public class SjdBannerController {


    @Autowired
    private IMlptBannnerService mlptBannnerService;

    /**
     *
     * @param request
     * @param response
     * @return  返回列表页面
     */

    @RequestMapping("/toList")
    public ModelAndView toList(HttpServletRequest request, HttpServletResponse response){
        ModelAndView  mv =new ModelAndView("/view/sjd/banner/list");
        return mv;
    }



    /**
     * 返回列表分页Json数据
     * @param request
     * @param response
     */

    @RequestMapping("/list")
    public Object list(HttpServletRequest request,HttpServletResponse response){
        EasyUiPage uiPage=null;
        Map<String,Object> map=MyRequestMapUtil.changeMap(request);
        uiPage=mlptBannnerService.getPage(map);
        return uiPage;
    }

}
